/*
 *  Box.h
 *  Cheeky Dice
 *
 *  Created by Dmitry Fadeev on 15.03.11.
 *  Copyright 2011 __MyCompanyName__. All rights reserved.
 *
 */
#pragma once

#include <xml/Object.h>
#include <lib3d/hard/IndexBuffer.h>
#include <lib3d/hard/VertexBuffer.h>
#include <lib3d/hard/Manager.h>
#include <HardwareDependentObject.h>
#include "PrimitiveObject.h"
#include "Node.h"
#include <lib3d/material/Shaders.h>
#include <CompilerFeatures.h>

namespace liba {
namespace lib3d {
namespace node {

class Box : public Node, public HardwareDependentObject<hard::Manager, PrimitiveObject>
{
	NODE_DEFINITION(Box)
private:
	material::Shaders shaders;
protected:
	virtual void on_add_hardware(hard::Manager::hardware_type * ha) LIBA_OVERRIDE;
	virtual bool on_node(xml::Provider * prov, const std::string & name) LIBA_OVERRIDE;
public:
	static const Atom node_name;
	static const Atom shaders_name;
public:
	Box(const Atom & name, Node * parent);
	virtual ~Box();
	virtual Box * Clone() LIBA_OVERRIDE;
	void create();
	virtual void RenderToList(hard::Hardware * hardware, hard::RenderList * render_list) LIBA_OVERRIDE;
};

} // namespace node
} // namespace lib3d
} // namespace liba